﻿using System;
using System.Collections.Generic;
using System.Web;
using UniversityManagementSystem.Manager;

namespace UniversityManagementSystem.DAL
{
    [Serializable]
    public class Teacher
    {
        TeacherManager manager = new TeacherManager();
        public string TeacherId { get; set; }
        public string TeacherName { get; set; }
        public string TeacherAddress { get; set; }
        public string TeacherEmail { get; set; }
        public string TeacherContact { get; set; }
        public string TeacherDesignation { get; set; }
        public string TeacherDeparment { get; set; }
        public double TeacherCredit { get; set; }
        public double TeacherRemainingCredit { get; set; }
        public double TeacherCreditOverflow { get; set; }
       
        public List<string> GetAllDesignations()
        {
            return manager.GetAllDesignations();
        }

        public string SaveAteacher(string teacherCredit)
        {
            if (!manager.IsNullOrBlank(teacherCredit) && manager.isNumber(teacherCredit))
            {
                TeacherCredit = Convert.ToDouble(teacherCredit);
                return manager.SaveTeacher(this);
            }
            else
            {
                return "Please enter valid number as the credit of the course.";
            }
        }
        public List<Teacher> GetTeachers(string department)
        {
            return manager.GetTeachers(department);
        }
    }
}